package com.ehsunbehravesh.mypasswords.gui;

import com.ehsunbehravesh.mypasswords.Utils;
import java.io.File;
import javax.swing.filechooser.FileFilter;

class XMLFileFilter extends FileFilter {

  public XMLFileFilter() {
  }

  @Override
  public boolean accept(File file) {
    if (file.isFile())
      return Utils.getFileExtension(file).toLowerCase().endsWith("xml");
    else
      return true;
  }

  @Override
  public String getDescription() {
    return "XML Files (*.xml)";
  }  
}
